from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
    return LaunchDescription([
        DeclareLaunchArgument(name='host', default_value='192.168.0.9',
                              description='主机IP'),
        DeclareLaunchArgument(name='port', default_value='8090',
                              description='端口'),

        Node(
            package='robot_voice',
            executable='wake_up'
        ),
        Node(
            package='robot_voice',
            executable='speech_recognition',
            parameters=[{'host': LaunchConfiguration('host')}, {
                'port': LaunchConfiguration('port')}]
        ),
        Node(
            package='robot_voice',
            executable='text_to_speech',
            parameters=[{'host': LaunchConfiguration('host')}, {
                'port': LaunchConfiguration('port')}]
        )
    ])
